package com.store.controller;
import java.net.URISyntaxException;
import java.util.List;

import com.store.comstant.BaseController;
import com.store.comstant.BasePageForm;
import com.store.comstant.HttpStatus;
import com.store.core.AjaxResult;
import com.store.entity.dto.FUserDTO;
import com.store.service.IFUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.util.Assert;
import com.baomidou.mybatisplus.core.metadata.IPage;


/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author json
 * @since 2021-10-10
 *
 */

@Slf4j
@RestController
@RequestMapping("/api/fUser")
@Api(value = "", tags = "接口")
public class FUserController extends BaseController {

    private static final String ENTITY_NAME = "fUser";

    @Autowired
    private IFUserService fUserService;



//    /**
//     *  新增批量数据.
//     */
//    @PostMapping("/createBatch")
//    @ApiOperation(value = "新增批量", notes = "传入参数")
//    public AjaxResult createBatch(@RequestBody List<FUserDTO> fUserList) {
//       Boolean  result = fUserService.insertBatch(fUserList);
//       if(result){
//           return AjaxResult.success();
//       }else {
//           return AjaxResult.error(HttpStatus.NOT_MODIFIED);
//       }
//    }
//
//     /**
//     *  新增数据.
//     */
//    @PostMapping("/create")
//    @ApiOperation(value = "新增", notes = "传入参数")
//    public AjaxResult<FUserDTO> create(@RequestBody FUserDTO fUserDTO) throws URISyntaxException {
//        FUserDTO result = fUserService.create(fUserDTO);
//        return AjaxResult.success(result);
//    }
//
//    /**
//     *  更新存在数据.
//     */
//    @PostMapping("/update")
//    @ApiOperation(value = "更新存在数据", notes = "传入参数")
//    public AjaxResult update(@RequestBody FUserDTO fUserDTO) {
//	    Assert.notNull(fUserDTO.getId(), "general.IdNotNull");
//        int count = fUserService.update(fUserDTO);
//        if(count > 0 ){
//            return AjaxResult.success();
//        }else {
//            return AjaxResult.error(HttpStatus.NOT_MODIFIED);
//        }
//    }
//
//     /**
//     *  删除存在数据.
//     */
//    @DeleteMapping("/delete/{id}")
//    @ApiOperation(value = "删除存在数据", notes = "传入参数")
//    public AjaxResult delete(@PathVariable Long id) {
//        int count = fUserService.delete(id);
//        if(count > 0 ){
//            return AjaxResult.success();
//        }else {
//            return AjaxResult.error(HttpStatus.NOT_MODIFIED);
//        }
//    }
//
//    /**
//     * 查询单条数据.
//     */
//    @GetMapping("/get/{id}")
//    @ApiOperation(value = "查询单条数据", notes = "传入参数")
//    public AjaxResult get(@PathVariable Long id) {
//        FUserDTO fUserDTO = fUserService.findOne(id);
//        return AjaxResult.success(fUserDTO);
//    }
//
//    /**
//    *  分页查询多条数据.
//    */
//    @GetMapping("/queryFUserPage")
//    @ApiOperation(value = "翻页查询多条数据", notes = "传入参数")
//    public AjaxResult<IPage<FUserDTO>> queryFUserPage(@RequestBody FUserDTO fUserDTO, BasePageForm basePageForm) {
//        IPage<FUserDTO> fUserList = fUserService.queryListPage(fUserDTO, basePageForm);
//        return AjaxResult.success(fUserList);
//    }
//
//   /**
//    * 查询多条数据.不分页
//    */
//   @GetMapping("/queryFUser")
//   @ApiOperation(value = "查询多条数据", notes = "传入参数")
//   public AjaxResult<List<FUserDTO>> queryFUser(FUserDTO fUserDTO) {
//       List<FUserDTO> list = fUserService.queryList(fUserDTO);
//       return AjaxResult.success(list);
//   }

}
